<?php
namespace app\common\model;

use think\Db;
use think\Model;

/**   YSF
 *    固件模型
 *    Date: 2018/8/6
 * Class RemoteFile
 * @package app\common\model
 */
class RemoteFile extends Model
{
    // 表名
    protected $name = 'remote_file';

    // 列表查询
    public function getAll($where=[], $page=1, $pageSize=100, $field='*', $order='add_time DESC')
    {
        $result = $this->where($where)
                    ->field($field)
                    ->page($page, $pageSize)
                    ->order($order)
                    ->select();
        return $result;
    }

    // 单条查询
    public function getOne($where, $field='*')
    {
        $result = $this->where($where)
                    ->field($field)
                    ->find();
        return $result;
    }

    // 编辑操作
    public function edit($where, $data)
    {
        $result = $this->where($where)->update($data);
        return $result;
    }

}